# Contributor: Usia Bechtle <usia@bechtlebox.de>
# Maintainer: jane400 <alpine@j4ne.de>
pkgname=railway
pkgver=2.5.0
pkgrel=0
pkgdesc="Railway lets you look up travel information for many different railways"
url="https://gitlab.com/schmiddi-on-mobile/railway"
# s390x, ppc64le, riscv64: rust-ring
arch="all !s390x !ppc64le !riscv64"
license="GPL-3.0-or-later"
makedepends="
	cargo
	desktop-file-utils
	gtk4.0-dev
	libadwaita-dev
	libglibutil-dev
	meson
	"
subpackages="$pkgname-lang"
source="https://gitlab.com/schmiddi-on-mobile/railway/-/archive/$pkgver/railway-$pkgver.tar.gz"
options="!check" # no tests

provides="diebahn=$pkgver-r$pkgrel"
replaces="diebahn"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}


build() {
	abuild-meson . output
	meson compile -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	cd "$pkgdir"/usr/bin
	ln -sv diebahn railway
}

sha512sums="
6e5760fbab354795f6ddd9b5de65ba7207afb8c7c5004797443b5850364b012837192a1282166089d58d177eb7ba98aaefc869e43352e988a672c8463dc02f11  railway-2.5.0.tar.gz
"
